define([path.result.html, path.result.css, 'pingpp'], function (page,css,pingpp) {

    var pid;
    var click={
        backHome:function(){
            location.hash='#list';
        },
        payAgain:function(){
            pingpp.createPayment(cache.charge, function (result, error) {
                //公众号支付
                if (result == "success") {
                    location.hash = '#success';
                }
                else if (result == "fail") {
                    location.hash = '#cancel';
                }
                else if (result == "cancel") {
                    location.hash = '#cancel';
                }
            });
        }
    };

    return {
        init: function (params) {
            pid = params.pid||null;
            $('#page').html(juicer(page,{result:params.result}));
            $('[data-click]').each(function () {
                $(this).click(click[$(this).attr('data-click')]);
            });
            document.title = '支付结果';
        }
    }
});